home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / C64 / E-Education / (c)e8.d64 / organic names.d (.txt) < prev    next >
Commodore BASIC  |  2007-02-04  |  11KB  |  385 lines

  1. 0 CLR:PRINT"[147]":POKE53280,11:POKE53281,11
  2. 4 OPEN2,8,2,"0:ORGANIC SET.D,S,R"
  3. 5 FORA=2048TO4095:GET#2,A$:POKEA,ASC(A$+CHR$(0)):NEXT:CLOSE2
  4. 6 POKE 53272,21
  5. 7 FORA=49152TO49180:READB:POKEA,B:NEXT
  6. 8 DATA 169,1,162,0,157,0,216,232,208,250,157,0,217,232,208,250,157,0,218,232
  7. 9 DATA208,250,157,0,219,232,208,250,96
  8. 10 SC=-31744:REM SC=1024-32768 FOR C64
  9. 12 REM     ORGANIC NOMENCLATURE
  10. 16 REM
  11. 20 REM        D. W. TRANKNER
  12. 24 REM
  13. 28 REM GENERALLY UP TO 10 CARBON ATOMS
  14. 32 REM
  15. 36 REM  300 1)   ALKANES (1-10)
  16. 38 REM  400 2) #-METHYL ALKANES (2-10)
  17. 40 REM  500 3) 1-ALKENES (2-10)
  18. 44 REM  600 4) 2-ALKENES (4-6)(C&T)
  19. 48 REM  700 5) 1-ALKYNES (2-6)
  20. 50 REM  800 6) 2-ALKYNES (4-6)
  21. 56 REM  900 7) #-ALKANOLS(1-6)
  22. 58 REM 1000 8) #-AMINES  (1-6)
  23. 60 REM 1100 9) #-HALO ALKANES(1-6)
  24. 62 REM 120010) ALKANALS-ONES (1-6)
  25. 66 REM 130012) ALKANOIC ACIDS(1-6)
  26. 68 REM 150013) ESTERS (METHYLÐYL)
  27. 70 REM
  28. 100 PRINT"[147]"TAB(10);"ORGANIC CHEMISTRY"
  29. 102 PRINT""TAB(12);"NOMENCLATURE
  30. 104 [129]I[178]1[164]1500:[130]I
  31. 200 [153]"LOAD"
  32. 204 [143]-LOWER (METHANE) ALKANYL GROUP-
  33. 205 EL$[178]"ONLEFT$^CMD#CMDLEFT$ONONLENWAIT&WAITCMDLEFT$CMDONONON_ONLEFT$"
  34. 209 [143]-UPPER (METHANE) ALKANYL GROUP-
  35. 210 EH$[178]"LEFT$ON_ONLENCMDCMDON!CMDONLEFT$ LEFT$CMD%CMD^LEFT$"
  36. 214 [143]-CENTER (ETHENE) ALKENYL GROUP-
  37. 215 AE$[178]" ^CMD_CMDONONLEN\LEN^CMDLEFT$CMDONONON_ONLEFT$"
  38. 219 [143]-CENTER (ETHYNE) ALKYNL GROUP-
  39. 220 AY$[178]"LEFT$[LEN]LEN[LEFT$"
  40. 238 Y$[178]""[170][202](AY$,2)[170]"CMD"
  41. 240 LA$[178]"CMD"[170]AE$[170]"CMDCMD"
  42. 242 UA$[178]"CMDONON"[170]AE$[170]"CMDCMD"
  43. 244 UH$[178]"CMDONONONLEFT$"
  44. 246 LH$[178]"CMDLEFT$ONONON"
  45. 248 LF$[178][200](EL$,25)
  46. 250 UF$[178][200](EH$,20)
  47. 252 LM$[178][202](EL$,4,22)
  48. 254 UM$[178][202](EH$,3,18)
  49. 256 LE$[178][202](EL$,4)
  50. 258 UE$[178][202](EH$,3)
  51. 260 [153]"LOAD      ORGANIC NAMES AND FORMULAE"
  52. 261 [153]"      TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB("
  53. 262 [153]"IN THIS PROGRAM YOU WILL BE GIVEN A"
  54. 263 [153]"SELECTION OF FUNCTIONAL GROUPS WITH"
  55. 264 [153]"WHICH TO PRACTICE YOUR ABILITY TO NAME"
  56. 265 [153]"ORGANIC MOLECULES FROM BOTH 3-D DIAGRAMS"
  57. 266 [153]"AND STRUCTURAL FORMULAE.
  58. 267 PRINT"THE MOLECULES ARE RANDOMLY GENERATED"
  59. 268 PRINT"AFTER EACH PUSH OF ANY KEY WITH THE"
  60. 269 PRINT"EXCEPTION OF THE ALKANES WITH WHICH YOU"
  61. 270 PRINT"CAN ALSO CALL FOR ANY SPECIFIC NUMBER OF"
  62. 271 PRINT"CARBON ATOMS USING THE NUMERIC KEYPAD."
  63. 272 PRINT"PRESS <RETURN>[146] WHEN READY";
  64. 273 GETA$:IFA$=""THEN273
  65. 278 POKE53272,21:RR=0:PRINT"[147]      ORGANIC NAMES AND FORMULAE"
  66. 279 PRINT"      [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  67. 280 PRINT"   1) ALKANES"
  68. 281 PRINT"   2) #-METHYL ALKANES"
  69. 282 PRINT"   3) 1-ALKENES"
  70. 283 PRINT"   4) 2-ALKENES (CIS&TRANS)"
  71. 284 PRINT"   5) 1-ALKYNES"
  72. 286 PRINT"   6) 2-ALKYNES"
  73. 288 PRINT"   7) #-ALKANOLS"
  74. 289 PRINT"   8) #-AMINO ALKANES"
  75. 290 PRINT"   9) #-CHLORO ALKANES"
  76. 291 PRINT"  10) ALKANALS-ONES"
  77. 292 PRINT"  11) ALKANOIC ACIDS"
  78. 293 PRINT"  12) ESTERS"
  79. 294 PRINT"  13) RANDOM MOLECULES"
  80. 297 PRINT"ENTER NUMBER THEN PRESS <RETURN>[146]"
  81. 298 PRINT"[145][145]WHAT SECTION DO YOU WANT";:INPUTA:POKE53272,19
  82. 299 ONAGOTO300,400,500,600,700,800,900,1000,1100,1200,1300,1400,1500
  83. 300 REM-'ALKANES'-RANDOM GENERATION AND        -NAMES FROM 1 TO 10 CARBON ATOMS
  84. 301 A=INT(2*RND(0)+1):REM-1 MEANS 3-D'S       -2 MEANS STR-FORM--
  85. 302 C=INT(10*RND(0)+1):FG$="ANE":  SM=0:SE=0:REM-FROM SUBSTITUENT SUB-ROUTINES-
  86. 304 PRINT"[147]":IFSE>0THENPRINT""
  87. 308 CT$="":N$="":TM$="":IFA=1ANDC=2*INT(C/2)THEN316
  88. 310 IFA=2THEN317
  89. 312 FORI=1TOC/2:GOTO320
  90. 316 FORI=1TOC/2-1
  91. 317 IFA=2THENFORI=1TOC-2
  92. 320 EE$=UE$:FF$=LF$:IFA=2THENEE$="[195][200]3":FF$=EE$
  93. 324 IFA=2ANDC=1THENTM$="[157]4":EE$="":GOTO345
  94. 326 IFC=1THENTM$="":EE$="_[145][200]":GOTO345
  95. 328 IFC=2THENTM$="":GOTO345
  96. 332 IFA=1THENTM$=TM$+UM$+LM$
  97. 333 IFA=2THENTM$=TM$+"[195][200]2"
  98. 340 IFA=1ANDC<>2*INT(C/2)THENEE$="_[145][200]"
  99. 344 NEXTI
  100. 345 E1$="":IFSE=1THENE1$="    "
  101. 346 IFSE=2THENE1$="       ":IFA=1THENFF$=UF$+"[157]"
  102. 347 IFSE>0ANDC=1ANDA=2THENTM$="[200]"
  103. 348 PRINT""FF$;E1$;TM$;EE$
  104. 350 IFSM=1THENRETURN
  105. 352 GETA$:IFA$=""THEN352
  106. 353 IFA=2THENA=1:GOTO355
  107. 354 IFA$="R"ANDA=1THENA=2
  108. 355 IFA$="R"THENPRINT"":GOTO308
  109. 358 PRINT"";
  110. 359 ONCGOSUB381,382,383,384,385,386,387,388,389,390
  111. 360 GETA$:IFA$=""THEN360
  112. 361 IFA$="/"THENC=10:GOTO304
  113. 362 Z=VAL(A$):IFZ>0THENC=Z:GOTO304
  114. 368 IFA$="X"THEN278
  115. 370 IFRR=1THEN RETURN
  116. 372 GOTO300
  117. 381 PRINTTAB(5);CT$;N$;"METH";FG$:RETURN
  118. 382 PRINTTAB(5);CT$;N$;"ETH";FG$:RETURN
  119. 383 PRINTTAB(5);CT$;N$;"PROP";FG$:RETURN
  120. 384 PRINTTAB(5);CT$;N$;"BUT";FG$:RETURN
  121. 385 PRINTTAB(5);CT$;N$;"PENT";FG$:RETURN
  122. 386 PRINTTAB(5);CT$;N$;"HEX";FG$:RETURN
  123. 387 PRINTTAB(5);CT$;N$;"HEPT";FG$;:RETURN
  124. 388 PRINTTAB(5);CT$;N$;"OCT";FG$;:RETURN
  125. 389 PRINTTAB(5);CT$;N$;"NON";FG$;:RETURN
  126. 390 PRINTTAB(5);CT$;N$;"DEC";FG$;:RETURN
  127. 400 REM-'#-METHYL ALKANES'-RANDOM         GENERATION FROM 2 TO 6 CARBON ATOMS
  128. 401 A=INT(2*RND(0)+1):REM-1 MEANS 3-D'S       -2 MEANS STR-FORM--
  129. 402 C=INT(8*RND(0)+2):            SA=0: SE=0:REM-FROM SUBSTITUENT SUB-ROUTINES-
  130. 404 X1=67:X2=72:X3=51
  131. 406 PRINT"[147]"
  132. 410 SM=1:GOSUB308
  133. 420 PRINT""
  134. 425 CH=INT(C*RND(0)+1):IFCH=1ORCH=C     THENCH=INT(C*RND(0)+1)
  135. 426 SYS49152:IFA=2THENN=3*CH:GOTO445
  136. 430 N=2*CH:IFCH=2*INT(CH/2)THEN440
  137. 435 POKESC+33370+N+SA,X1:POKESC+33371+N+SA,X2:IFSA=0THENPOKESC+33372+N+SA,X3
  138. 437 GOTO452
  139. 440 IFPEEK(SC+33172+N+SA)=28THENX3=28
  140. 442 POKESC+33130+N+SA,X1:POKESC+33131+N+SA,X2:IFSA=0THENPOKESC+33132+N+SA,X3
  141. 444 GOTO452
  142. 445 POKESC+33207+N,40:POKESC+33167+N,X1:POKESC+33168+N,X2:POKESC+33169+N,X3
  143. 447 IFPEEK(SC+33249+N)=51THENPOKESC+33249+N,50:GOTO452
  144. 448 POKESC+33249+N,49
  145. 452 IFSA=1THENRETURN
  146. 453 IFSB=1THENRETURN
  147. 454 GETA$:IFA$=""THEN454
  148. 455 PRINT"";
  149. 456 IFC=2THENC=C+1:N$="":CT$="":GOTO460
  150. 457 N$="METHYL ":CT$=STR$(CH)+"-":IFC>2ANDCH>C/2THENCT$=STR$(C-CH+1)+"-"
  151. 459 IFCT$=" 1-"THENCT$="":N$="":C=C+1
  152. 460 FG$="ANE":ONCGOSUB381,382,383,384,385,386,387,388,389,390
  153. 465 GETA$:IFA$=""THEN465
  154. 468 IFA$="X"THEN278
  155. 470 IFRR=1THENRETURN
  156. 472 GOTO400
  157. 500 REM-'1-ALKENES'-RANDOM GENERATION       AND NAMES FROM 2 TO 10 CARBON ATOMS
  158. 501 A=INT(2*RND(0)+1):REM-1 MEANS 3-D'S       -2 MEANS STR-FORM--
  159. 502 C=INT(9*RND(0)+2)
  160. 504 PRINT"[147]"
  161. 508 FG$="ENE":CT$="":TM$=""
  162. 510 IFA=2THEN517
  163. 512 FORI=2TOC/2:GOTO520
  164. 517 IFA=2THENFORI=2TOC-2
  165. 520 EE$=UE$:FF$="[200][145]"+UH$+UA$:IFA=2THENEE$="[195][200]3":FF$="[200]2[195]\[195][200]"
  166. 524 IFC=2ANDA=1THENTM$="":EE$="_[145][200]":GOTO548
  167. 526 IFC=2ANDA=2THENTM$="":EE$="2":GOTO548
  168. 528 IFC=3THENTM$="":GOTO548
  169. 532 IFA=1THENTM$=TM$+UM$+LM$
  170. 533 IFA=2THENTM$=TM$+"[195][200]2"
  171. 540 IFA=1ANDC=2*INT(C/2)THENEE$="_[145][200]"
  172. 544 NEXTI
  173. 548 PRINT"";FF$;TM$;EE$
  174. 552 GETA$:IFA$=""THEN552
  175. 555 PRINT"";
  176. 556 N$="1-":IFC<3THENN$=""
  177. 557 ONCGOSUB381,382,383,384,385,386,387,388,389,390
  178. 560 GETA$:IFA$=""THEN560
  179. 568 IFA$="X"THEN278
  180. 570 IFRR=1THENRETURN
  181. 572 GOTO500
  182. 600 REM-'2-ALKENES'-RANDOM GENERATION       AND NAMES FROM 4 TO 10 CARBON ATOMS
  183. 602 C=INT(7*RND(0)+4)
  184. 604 PRINT"[147]"
  185. 608 FG$="ENE":TM$="":IFC=2*INT(C/2)THEN616
  186. 612 FORI=2TOC/2:GOTO620
  187. 616 FORI=2TOC/2-1
  188. 620 EE$=UE$
  189. 624 IFC=4THENTM$="":GOTO646
  190. 632 TM$=TM$+UM$+LM$
  191. 640 IFC<>2*INT(C/2)THENEE$="_[145][200]"
  192. 644 NEXTI
  193. 646 D=INT(2*RND(0)+1):ONDGOTO648,650
  194. 648 PRINT" ";UF$;LH$;LA$;TM$;EE$:CT$="CIS-":GOTO652
  195. 650 PRINT" ";LF$;UH$;"[145][145]";LA$;TM$;EE$:CT$="TRANS-"
  196. 652 GETA$:IFA$=""THEN652
  197. 655 PRINT"";
  198. 656 N$="2-":ONCGOSUB381,382,383,384,385,386,387,388,389,390
  199. 660 GETA$:IFA$=""THEN660
  200. 668 IFA$="X"THEN278
  201. 670 IFRR=1THENRETURN
  202. 672 GOTO600
  203. 700 REM-'1-ALKYNES'-RANDOM GENERATION       AND NAMES FROM 2 TO 6 CARBON ATOMS
  204. 701 A=INT(2*RND(0)+1):REM-1 MEANS 3-D'S       -2 MEANS STR-FORM--
  205. 702 C=INT(5*RND(0)+2)
  206. 704 PRINT"[147]"
  207. 708 FG$="YNE":CT$="":TM$=""
  208. 710 IFA=2THEN717
  209. 712 FORI=2TOC/2:GOTO720
  210. 717 IFA=2THENFORI=2TOC-2
  211. 720 EE$=UE$:FF$="[200][145]"+Y$:IFA=2THENEE$="[195][200]3":FF$=AY$+"[157]"
  212. 724 IFC=2THENTM$="":EE$="":GOTO748
  213. 726 IFC=3ANDA=1THENEE$=MID$(UE$,2):GOTO748
  214. 728 IFC=3ANDA=2THEN748
  215. 730 MM$=UM$:IFI=2THENMM$=MID$(UM$,2)
  216. 732 IFA=1THENTM$=TM$+MM$+LM$
  217. 733 IFA=2THENTM$=TM$+"[195][200]2"
  218. 740 IFA=1ANDC=2*INT(C/2)THENEE$="_[145][200]"
  219. 744 NEXTI
  220. 748 PRINT"";FF$;TM$;EE$
  221. 752 GETA$:IFA$=""THEN752
  222. 755 PRINT"";
  223. 756 N$="1-":IFC=2THENN$=""
  224. 757 ONCGOSUB381,382,383,384,385,386
  225. 760 GETA$:IFA$=""THEN760
  226. 768 IFA$="X"THEN278
  227. 770 IFRR=1THENRETURN
  228. 772 GOTO700
  229. 800 REM-'2-ALKYNES'-RANDOM GENERATION       AND NAMES FROM 4 TO 6 CARBON ATOMS
  230. 801 A=INT(2*RND(0)+1):REM-1 MEANS 3-D'S       -2 MEANS STR-FORM--
  231. 802 C=INT(3*RND(0)+4)
  232. 804 PRINT"[147]"
  233. 808 FG$="YNE":CT$="":TM$=""
  234. 810 IFA=2THEN817
  235. 812 FORI=2TOC/2-1:GOTO820
  236. 817 IFA=2THENFORI=2TOC-3
  237. 820 EE$=UE$:FF$=LF$:YY$=Y$:IFA=2THENEE$="[195][200]3":FF$=EE$+"[145][157]":YY$=Y$+"[145]"
  238. 826 IFC=4ANDA=1THENEE$=MID$(UE$,2):GOTO848
  239. 828 IFC=4ANDA=2THEN848
  240. 830 MM$=UM$:IFI=2THENMM$=MID$(UM$,2)
  241. 832 IFA=1THENTM$=TM$+MM$+LM$
  242. 833 IFA=2THENTM$=TM$+"[195][200]2"
  243. 840 IFA=1ANDC<>2*INT(C/2)THENEE$="_[145][200]"
  244. 844 NEXTI
  245. 848 PRINT"";FF$;YY$;TM$;EE$
  246. 852 GETA$:IFA$=""THEN852
  247. 855 PRINT"";
  248. 856 N$="2-":ONCGOSUB381,382,383,384,385,386
  249. 860 GETA$:IFA$=""THEN860
  250. 868 IFA$="X"THEN278
  251. 870 IFRR=1THENRETURN
  252. 872 GOTO800
  253. 900 REM-'#-ALKANOLS'-RANDOM GENERATION    AND NAMES FROM 1 TO 6 CARBON ATOMS
  254. 901 A=INT(2*RND(0)+1):REM-1 MEANS 3-D'S       -2 MEANS STR-FORM--
  255. 902 C=INT(6*RND(0)+1):IFA=2ANDC=1THENC=2
  256. 904 X1=79:X2=72:X3=32
  257. 905 SA=1:GOSUB406
  258. 908 FG$="ANOL":CT$=""
  259. 952 GETA$:IFA$=""THEN952
  260. 955 PRINT"";
  261. 957 N$=STR$(CH)+"-":IFCH>C/2THENN$=STR$(C-CH+1)+"-"
  262. 958 IFC<3THENN$=""
  263. 960 ONCGOSUB381,382,383,384,385,386
  264. 965 GETA$:IFA$=""THEN965
  265. 968 IFA$="X"THEN278
  266. 970 IFRR=1THENRETURN
  267. 972 GOTO900
  268. 1000 REM-'#-AMINO ALKANES'-RANDOM GENERATION AND NAMES FROM 1 TO 6 CARBON ATOM
  269. 1001 A=INT(2*RND(0)+1):REM-1 MEANS 3-D'S       -2 MEANS STR-FORM--
  270. 1002 C=INT(6*RND(0)+1):SA=0:IFA=2ANDC=1THENC=2
  271. 1004 X1=78:X2=72:X3=50
  272. 1005 SM=1:SB=1:GOSUB406
  273. 1008 FG$="ANE":N$="AMINO "
  274. 1052 GETA$:IFA$=""THEN1052
  275. 1055 PRINT"";
  276. 1057 CT$=STR$(CH)+"-":IFCH>C/2THENCT$=STR$(C-CH+1)+"-"
  277. 1058 IFC=1THENCT$=""
  278. 1060 ONCGOSUB381,382,383,384,385,386
  279. 1065 GETA$:IFA$=""THEN1065
  280. 1068 IFA$="X"THEN278
  281. 1070 IFRR=1THENRETURN
  282. 1072 GOTO1000
  283. 1100 REM-'#-CHLORO ALKAES'-RANDOM GENERATIONAND NAMES FROM 1 TO 6 CARBON ATOMS
  284. 1101 A=INT(2*RND(0)+1):REM-1 MEANS 3-D'S       -2 MEANS STR-FORM--
  285. 1102 C=INT(6*RND(0)+1):IFA=2ANDC=1THENC=2
  286. 1104 X1=67:X2=12:X3=32
  287. 1105 SA=1:GOSUB406
  288. 1108 FG$="ANE":N$="CHLORO "
  289. 1152 GETA$:IFA$=""THEN1152
  290. 1155 PRINT"";
  291. 1157 CT$=STR$(CH)+"-":IFCH>C/2THENCT$=STR$(C-CH+1)+"-"
  292. 1158 IFC=1THENCT$=""
  293. 1160 ONCGOSUB381,382,383,384,385,386
  294. 1165 GETA$:IFA$=""THEN1165
  295. 1168 IFA$="X"THEN278
  296. 1170 IFRR=1THENRETURN
  297. 1172 GOTO1100
  298. 1200 REM-'ALKANAL-ONES'-RANDOM GENERATION AND NAMES FROM 1 TO 6 CARBON ATOMS
  299. 1201 A=INT(2*RND(0)+1):REM-1 MEANS 3-D'S       -2 MEANS STR-FORM--
  300. 1202 C=INT(6*RND(0)+1):SO=0
  301. 1204 X1=79:X2=32:X3=72:X4=41:X5=27
  302. 1206 PRINT"[147]"
  303. 1208 SM=1:GOSUB308
  304. 1210 FG$="ANONE":N$=""
  305. 1220 PRINT""
  306. 1225 CH=INT(C*RND(0)+1)
  307. 1226 SYS49152:IFA=2THENN=3*CH:GOTO1245
  308. 1230 N=2*CH:IFCH=2*INT(CH/2)THEN1240
  309. 1235 POKESC+33369+N,X2:POKESC+33370+N,X1:POKESC+33371+N,X2:POKESC+33329+N,X2
  310. 1237 POKESC+33330+N,X4:POKESC+33331+N,X2:GOTO1252
  311. 1240 POKESC+33129+N,X2:POKESC+33130+N,X1:POKESC+33131+N,X2:POKESC+33169+N,X2
  312. 1242 POKESC+33170+N,X4:POKESC+33171+N,X2:GOTO1252
  313. 1245 POKE1424+N,X1:POKESC+33208+N,X4:POKESC+33247+N,X5:POKESC+33248+N,67:POKESC+33249+N,X5
  314. 1246 IFCH=CANDA=2THENPOKESC+33250+N,72
  315. 1247 IFCH=1ANDA=2THENPOKESC+33246+N,72
  316. 1248 POKESC+33289+N,32
  317. 1252 GETA$:IFA$=""THEN1252
  318. 1255 PRINT"";
  319. 1257 CT$=STR$(CH)+"-":IFCH>C/2THENCT$=STR$(C-CH+1)+"-"
  320. 1258 IFCH=1ORCH=CTHENFG$="ANAL":CT$=""
  321. 1260 ONCGOSUB381,382,383,384,385,386
  322. 1265 GETA$:IFA$=""THEN1265
  323. 1268 IFA$="X"THEN278
  324. 1270 IFRR=1THENRETURN
  325. 1272 GOTO1200
  326. 1300 REM-'ALKANOIC ACIDS'-RANDOM GENERATION AND NAMES FROM 1 TO 6 CARBON ATOMS
  327. 1301 A=INT(2*RND(0)+1):REM-1 MEANS 3-D'S       -2 MEANS STR-FORM--
  328. 1302 C=INT(6*RND(0)+0)
  329. 1304 X1=79:X2=32:X3=72:X4=40:X5=45
  330. 1306 PRINT"[147]"
  331. 1307 IFC=0ANDA=1THENPRINT"[200][":GOTO1320
  332. 1308 IFC=0THENGOTO1320
  333. 1310 SM=1:GOSUB308
  334. 1320 PRINT""
  335. 1325 C=C+1:CH=C
  336. 1326 SYS49152:IFA=2THENN=3*CH:GOTO1345
  337. 1330 N=2*CH:IFCH=2*INT(CH/2)THEN1340
  338. 1335 POKESC+33290+N,67:POKESC+33331+N,30:POKESC+33372+N,X1
  339. 1336 POKESC+33373+N,X3:POKESC+33212+N,X1
  340. 1337 POKESC+33251+N,43:GOTO1352
  341. 1340 POKESC+33130+N,X2:POKESC+33210+N,67:POKESC+33171+N,43:POKESC+33132+N,X1
  342. 1342 POKESC+33251+N,30:POKESC+33292+N,X1:POKESC+33293+N,X3:GOTO1352
  343. 1345 POKESC+33169+N,X1:POKESC+33208+N,43:POKESC+33247+N,67:ZZ=SC+33329+N
  344. 1346 IFCH=CANDA=2THENPOKESC+33288+N,30:POKEZZ,X1:POKESC+33330+N,X3:IFC=1THENPOKESC+33249,72
  345. 1347 IFPEEK(SC+33246+N)=51THENPOKESC+33246+N,50:GOTO1352
  346. 1348 IFPEEK(SC+33246+N)=52THENPOKESC+33246+N,51:GOTO1352
  347. 1352 GETA$:IFA$=""THEN1352
  348. 1355 PRINT"";
  349. 1358 FG$="ANOIC ACID":CT$=""
  350. 1360 ONCGOSUB381,382,383,384,385,386
  351. 1365 GETA$:IFA$=""THEN1365
  352. 1368 IFA$="X"THEN278
  353. 1370 IFRR=1THENRETURN
  354. 1372 GOTO1300
  355. 1400 REM-'ESTERS'-RANDOM GENERATION          AND NAMES FROM 1 TO 6 CARBON ATOMS
  356. 1401 A=INT(2*RND(0)+1):REM-1 MEANS 3-D'S       -2 MEANS STR-FORM--
  357. 1402 C=INT(6*RND(0)+1)
  358. 1404 FG$="ANOATE":ES$="_[145][207]^[195][157])[157][207]"  :SS$=LM$
  359. 1408 SE=INT(2*RND(0)+1):ONSEGOTO1410,1430
  360. 1410 SE=1:SM=1:GOSUB304
  361. 1412 IFA=2THENES$="[145][207][[195][145][157])[145][157][207][":GOTO1420
  362. 1415 IFC=2*INT(C/2)THENPRINT"[145][145]";
  363. 1420 PRINT"";ES$
  364. 1423 CT$="METHYL "
  365. 1425 GOTO1452
  366. 1430 SE=2:SM=1:GOSUB304
  367. 1432 IFA=1ANDC<>2*INT(C/2)THENPRINT"";
  368. 1435 IFA=2THENES$="[195][200]2[207][[195][145][157])[145][157][207][":SS$=""
  369. 1440 PRINT"[145][145]";SS$;ES$
  370. 1445 CT$="ETHYL "
  371. 1452 GETA$:IFA$=""THEN1452
  372. 1455 PRINT"";
  373. 1460 ONCGOSUB381,382,383,384,385,386
  374. 1462 SE=0
  375. 1465 GETA$:IFA$=""THEN1465
  376. 1468 IFA$="X"THEN278
  377. 1470 IFRR=1THENRETURN
  378. 1472 GOTO1400
  379. 1500 REM-RANDOM NAMES AND FORMULAS-
  380. 1510 RR=1:SE=0:SB=0:FG$="":N$="":CT$=""
  381. 1520 I=INT(12*RND(0)+1)
  382. 1530 ONIGOSUB300,400,500,600,700,800,900,1000,1100,1200,1300,1400
  383. 1550 GOTO1510
  384. 9999 END
  385.